   var b;
   
cc.Class({
    extends: cc.Component,

     properties: {
        bool:Boolean
     },
  start: function () {
        // var node = this.node;
       var button = this.getComponent(cc.Button);
         button.normalColor=new cc.Color(255, 255, 255, 128)
        var timeCallback = function (dt) {
      
          b=cc.randomMinus1To1 ( ) ;    
           (b>0)?this.bool=true:this.bool=false
            if(this.bool==true){
             button.normalColor=new cc.Color(0, 0,255, 128);
            }
            else
             button.normalColor=new cc.Color(255,255, 255, 128);
    
    }
    this.schedule(timeCallback, 1);
    },
    // use this for initialization
    onLoad: function () {
    },

    // alled every frame, uncomment this function to activate update callback
     update: function () {

        },
});
 